package com.fb.cvstool;

import org.dom4j.Element;

public class NodeBean {

	public String getDateStr() {
		return dateStr;
	}

	public void setDateStr(String dateStr) {
		this.dateStr = dateStr;
	}

	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getFileFullName() {
		return fileFullName;
	}

	public void setFileFullName(String fileFullName) {
		this.fileFullName = fileFullName;
	}

	public String getRevision() {
		return revision;
	}

	public void setRevision(String revision) {
		this.revision = revision;
	}

	public String getPreRevision() {
		return preRevision;
	}

	public void setPreRevision(String preRevision) {
		this.preRevision = preRevision;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	private String dateStr;
	private String time;
	private String author;
	private String fileName;
	private String fileFullName;
	private String revision;
	private String preRevision;
	private String msg;

	public NodeBean convertElementToBean(Element elm) {
		this.setDateStr(elm.element("date").getText());
		this.setTime(elm.element("time").getText());
		this.setAuthor(elm.element("author").getText());
		this.setAuthor(elm.element("file").element("name").getText());
		this.setFileFullName(elm.element("file").element("fullName").getText());
		this.setRevision(elm.element("file").element("revision").getText());
		if (elm.element("file").element("prevrevision") != null) {
			this.setPreRevision(elm.element("file").element("prevrevision")
					.getText());
		}
		if (elm.element("file").element("msg") != null) {
			this.setMsg(elm.element("file").element("msg").getText());
		}
		
		Element ele =  elm.element("file").element("dead");
		if(ele!=null) {
			System.out.println("---file:" + this.getFileFullName());
			System.out.println("---ele:" + ele);
		}

		return this;
	}

}
